layui.config({
    base: '../../layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index'], function(){
    var $ = layui.$
    ,form = layui.form
    ,admin = layui.admin;

    var uid = layui.router().search.id;
    var typeCode = layui.router().search.typeCode;
    if(uid != undefined && uid != ""){
        admin.req({
            type:"GET",
            url:"/api/admin/dictlist/"+uid,     
            dataType:"json",
            success:function(res){
                // 表示是修改数据
                var data = res.data;
                if(res.code==200){
                    form.val('dictListForm', data);
                }
               
            },
            error:function(jqXHR){
                alert("发生错误："+ jqXHR.status);
            }
          });
        
    } else {
      form.val('dictListForm', {
        typeCode:typeCode
      });
    }

 
  
  });